package com.anjufang.controller.system;

import com.anjufang.controller.BaseController;
import com.anjufang.entity.GroupDetail;
import com.anjufang.entity.GroupInfo;
import com.anjufang.service.system.GroupDetailService;
import com.anjufang.service.system.GroupInfoService;
import com.anjufang.utils.Result;
import com.anjufang.utils.page.PageUtils;
import com.anjufang.utils.page.Query;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/group/detail")
public class GroupDetailController extends BaseController {

	@Autowired
	private GroupDetailService groupDetailService;

	/**
	 * 所有
	 */
	@RequestMapping(value = LIST)
    public PageUtils list(@RequestParam Map<String, Object> params) {
        // 查询列表数据
        Query query = new Query(params);
        List<GroupDetail> groupDetails = groupDetailService.queryList(query);
        int total = groupDetailService.queryTotal(query);
        PageUtils pageUtil = new PageUtils(groupDetails, total, query.getLimit(), query.getPage());

        return pageUtil;
    }
	
}
